\(\int (e x)^{-1+n} (a+b \csc (c+d x^n)) \, dx\) [73]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [B] (verification not implemented)
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 20, antiderivative size = 45 \[ \int (e x)^{-1+n} \left (a+b \csc \left (c+d x^n\right )\right ) \, dx=\frac {a (e x)^n}{e n}-\frac {b x^{-n} (e x)^n \text {arctanh}\left (\cos \left (c+d x^n\right )\right )}{d e n} \]

[Out]

a*(e*x)^n/e/n-b*(e*x)^n*arctanh(cos(c+d*x^n))/d/e/n/(x^n)

Rubi [A] (verified)

Time = 0.06 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {14, 4294, 4290, 3855} \[ \int (e x)^{-1+n} \left (a+b \csc \left (c+d x^n\right )\right ) \, dx=\frac {a (e x)^n}{e n}-\frac {b x^{-n} (e x)^n \text {arctanh}\left (\cos \left (c+d x^n\right )\right )}{d e n} \]

[In]

Int[(e*x)^(-1 + n)*(a + b*Csc[c + d*x^n]),x]

[Out]

(a*(e*x)^n)/(e*n) - (b*(e*x)^n*ArcTanh[Cos[c + d*x^n]])/(d*e*n*x^n)

Rule 14

Int[(u_)*((c_.)*(x_))^(m_.), x_Symbol] :> Int[ExpandIntegrand[(c*x)^m*u, x], x] /; FreeQ[{c, m}, x] && SumQ[u]
 &&  !LinearQ[u, x] &&  !MatchQ[u, (a_) + (b_.)*(v_) /; FreeQ[{a, b}, x] && InverseFunctionQ[v]]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 4290

Int[((a_.) + Csc[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*(x_)^(m_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplif
y[(m + 1)/n] - 1)*(a + b*Csc[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p}, x] && IGtQ[Simplify[
(m + 1)/n], 0] && IntegerQ[p]

Rule 4294

Int[((a_.) + Csc[(c_.) + (d_.)*(x_)^(n_)]*(b_.))^(p_.)*((e_)*(x_))^(m_.), x_Symbol] :> Dist[e^IntPart[m]*((e*x
)^FracPart[m]/x^FracPart[m]), Int[x^m*(a + b*Csc[c + d*x^n])^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p}, x]

Rubi steps \begin{align*} \text {integral}& = \int \left (a (e x)^{-1+n}+b (e x)^{-1+n} \csc \left (c+d x^n\right )\right ) \, dx \\ & = \frac {a (e x)^n}{e n}+b \int (e x)^{-1+n} \csc \left (c+d x^n\right ) \, dx \\ & = \frac {a (e x)^n}{e n}+\frac {\left (b x^{-n} (e x)^n\right ) \int x^{-1+n} \csc \left (c+d x^n\right ) \, dx}{e} \\ & = \frac {a (e x)^n}{e n}+\frac {\left (b x^{-n} (e x)^n\right ) \text {Subst}\left (\int \csc (c+d x) \, dx,x,x^n\right )}{e n} \\ & = \frac {a (e x)^n}{e n}-\frac {b x^{-n} (e x)^n \text {arctanh}\left (\cos \left (c+d x^n\right )\right )}{d e n} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.51 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.36 \[ \int (e x)^{-1+n} \left (a+b \csc \left (c+d x^n\right )\right ) \, dx=\frac {x^{-n} (e x)^n \left (a \left (c+d x^n\right )-b \log \left (\cos \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )+b \log \left (\sin \left (\frac {1}{2} \left (c+d x^n\right )\right )\right )\right )}{d e n} \]

[In]

Integrate[(e*x)^(-1 + n)*(a + b*Csc[c + d*x^n]),x]

[Out]

((e*x)^n*(a*(c + d*x^n) - b*Log[Cos[(c + d*x^n)/2]] + b*Log[Sin[(c + d*x^n)/2]]))/(d*e*n*x^n)

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 1.01 (sec) , antiderivative size = 158, normalized size of antiderivative = 3.51

method result size
risch \(\frac {a x \,{\mathrm e}^{\frac {\left (-1+n \right ) \left (-i \operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right ) \pi +i \operatorname {csgn}\left (i e \right ) \operatorname {csgn}\left (i e x \right )^{2} \pi +i \operatorname {csgn}\left (i x \right ) \operatorname {csgn}\left (i e x \right )^{2} \pi -i \operatorname {csgn}\left (i e x \right )^{3} \pi +2 \ln \left (e \right )+2 \ln \left (x \right )\right )}{2}}}{n}-\frac {2 \,\operatorname {arctanh}\left ({\mathrm e}^{i \left (c +d \,x^{n}\right )}\right ) e^{n} b \,{\mathrm e}^{\frac {i \pi \,\operatorname {csgn}\left (i e x \right ) \left (-1+n \right ) \left (\operatorname {csgn}\left (i e x \right )-\operatorname {csgn}\left (i x \right )\right ) \left (-\operatorname {csgn}\left (i e x \right )+\operatorname {csgn}\left (i e \right )\right )}{2}}}{d e n}\) \(158\)

[In]

int((e*x)^(-1+n)*(a+b*csc(c+d*x^n)),x,method=_RETURNVERBOSE)

[Out]

a/n*x*exp(1/2*(-1+n)*(-I*csgn(I*e)*csgn(I*x)*csgn(I*e*x)*Pi+I*csgn(I*e)*csgn(I*e*x)^2*Pi+I*csgn(I*x)*csgn(I*e*
x)^2*Pi-I*csgn(I*e*x)^3*Pi+2*ln(e)+2*ln(x)))-2*arctanh(exp(I*(c+d*x^n)))/d/e*e^n/n*b*exp(1/2*I*Pi*csgn(I*e*x)*
(-1+n)*(csgn(I*e*x)-csgn(I*x))*(-csgn(I*e*x)+csgn(I*e)))

Fricas [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.38 \[ \int (e x)^{-1+n} \left (a+b \csc \left (c+d x^n\right )\right ) \, dx=\frac {2 \, a d e^{n - 1} x^{n} - b e^{n - 1} \log \left (\frac {1}{2} \, \cos \left (d x^{n} + c\right ) + \frac {1}{2}\right ) + b e^{n - 1} \log \left (-\frac {1}{2} \, \cos \left (d x^{n} + c\right ) + \frac {1}{2}\right )}{2 \, d n} \]

[In]

integrate((e*x)^(-1+n)*(a+b*csc(c+d*x^n)),x, algorithm="fricas")

[Out]

1/2*(2*a*d*e^(n - 1)*x^n - b*e^(n - 1)*log(1/2*cos(d*x^n + c) + 1/2) + b*e^(n - 1)*log(-1/2*cos(d*x^n + c) + 1
/2))/(d*n)

Sympy [F]

\[ \int (e x)^{-1+n} \left (a+b \csc \left (c+d x^n\right )\right ) \, dx=\int \left (e x\right )^{n - 1} \left (a + b \csc {\left (c + d x^{n} \right )}\right )\, dx \]

[In]

integrate((e*x)**(-1+n)*(a+b*csc(c+d*x**n)),x)

[Out]

Integral((e*x)**(n - 1)*(a + b*csc(c + d*x**n)), x)

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 128 vs. \(2 (45) = 90\).

Time = 0.29 (sec) , antiderivative size = 128, normalized size of antiderivative = 2.84 \[ \int (e x)^{-1+n} \left (a+b \csc \left (c+d x^n\right )\right ) \, dx=\frac {\left (e x\right )^{n} a}{e n} - \frac {{\left (e^{n} \log \left (\cos \left (d x^{n}\right )^{2} + 2 \, \cos \left (d x^{n}\right ) \cos \left (c\right ) + \cos \left (c\right )^{2} + \sin \left (d x^{n}\right )^{2} - 2 \, \sin \left (d x^{n}\right ) \sin \left (c\right ) + \sin \left (c\right )^{2}\right ) - e^{n} \log \left (\cos \left (d x^{n}\right )^{2} - 2 \, \cos \left (d x^{n}\right ) \cos \left (c\right ) + \cos \left (c\right )^{2} + \sin \left (d x^{n}\right )^{2} + 2 \, \sin \left (d x^{n}\right ) \sin \left (c\right ) + \sin \left (c\right )^{2}\right )\right )} b}{2 \, d e n} \]

[In]

integrate((e*x)^(-1+n)*(a+b*csc(c+d*x^n)),x, algorithm="maxima")

[Out]

(e*x)^n*a/(e*n) - 1/2*(e^n*log(cos(d*x^n)^2 + 2*cos(d*x^n)*cos(c) + cos(c)^2 + sin(d*x^n)^2 - 2*sin(d*x^n)*sin
(c) + sin(c)^2) - e^n*log(cos(d*x^n)^2 - 2*cos(d*x^n)*cos(c) + cos(c)^2 + sin(d*x^n)^2 + 2*sin(d*x^n)*sin(c) +
 sin(c)^2))*b/(d*e*n)

Giac [F]

\[ \int (e x)^{-1+n} \left (a+b \csc \left (c+d x^n\right )\right ) \, dx=\int { {\left (b \csc \left (d x^{n} + c\right ) + a\right )} \left (e x\right )^{n - 1} \,d x } \]

[In]

integrate((e*x)^(-1+n)*(a+b*csc(c+d*x^n)),x, algorithm="giac")

[Out]

integrate((b*csc(d*x^n + c) + a)*(e*x)^(n - 1), x)

Mupad [B] (verification not implemented)

Time = 20.02 (sec) , antiderivative size = 106, normalized size of antiderivative = 2.36 \[ \int (e x)^{-1+n} \left (a+b \csc \left (c+d x^n\right )\right ) \, dx=\frac {{\left (e\,x\right )}^n\,\left (a\,d\,x^n+b\,\ln \left (b\,{\left (e\,x\right )}^{n-1}\,2{}\mathrm {i}-b\,{\mathrm {e}}^{c\,1{}\mathrm {i}}\,{\mathrm {e}}^{d\,x^n\,1{}\mathrm {i}}\,{\left (e\,x\right )}^{n-1}\,2{}\mathrm {i}\right )-b\,\ln \left (-b\,{\left (e\,x\right )}^{n-1}\,2{}\mathrm {i}-b\,{\mathrm {e}}^{c\,1{}\mathrm {i}}\,{\mathrm {e}}^{d\,x^n\,1{}\mathrm {i}}\,{\left (e\,x\right )}^{n-1}\,2{}\mathrm {i}\right )\right )}{d\,e\,n\,x^n} \]

[In]

int((a + b/sin(c + d*x^n))*(e*x)^(n - 1),x)

[Out]

((e*x)^n*(b*log(b*(e*x)^(n - 1)*2i - b*exp(c*1i)*exp(d*x^n*1i)*(e*x)^(n - 1)*2i) - b*log(- b*(e*x)^(n - 1)*2i
- b*exp(c*1i)*exp(d*x^n*1i)*(e*x)^(n - 1)*2i) + a*d*x^n))/(d*e*n*x^n)